package com.itheima.exerciseTest.test10_19;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Test18 {
    public static void main(String[] args) throws ParseException {
        // 创建当前时间对象
        Date date = new Date();
        System.out.println(date);

        // 创建模板对象
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("y-M-d a h:m:s S 时区-z");

        String format = simpleDateFormat.format(date);
        System.out.println(format);

        String s = "2008-02-24 上午 1:12:13 14 时区-CST";

        Date date2 = simpleDateFormat.parse(s);
        System.out.println(date2);
    }
}
